package com.example.dao;

import com.example.mapper.BillMapper;
import com.example.pojo.Bill;
import com.example.pojo.BillItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Component
public class BillDao {
    @Autowired
    private BillMapper billMapper;

    @GetMapping
    public List<Bill> findBillByCustomerId(Long CustomerId) {
        return billMapper.selectBillByCustomerId(CustomerId);
    }

    public List<BillItem> findBillItemsByBillId(Long billId) {
        return billMapper.selectBillItemsByBillId(billId);
    }
}
